<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>

<f:subview id="product">
<h:form id="productForm">
<h:outputText value="Items for Product " styleClass="title"/>
<h:outputText value="#{productPageBean.productName}" styleClass="title highLight2" />
<h:dataTable id="productTable" value="#{productPageBean.pagedListHolder.pageList}" var="item"  
	styleClass="box" columnClasses=", rightAlign">
  <h:column>
    <h:panelGrid columns="1">
      <h:outputLink  value="item.jsf?itemId=#{item.itemId}">
          <h:outputText value="#{item.attribute1}" />
          <h:outputText value="#{item.productName}"/>
      </h:outputLink>
      <h:outputText value="#{item.description}" escape="false" />
    </h:panelGrid>
  </h:column>
  <h:column>
    <h:panelGrid columns="1">
      <h:outputText value="#{item.unitCost}">
	    <f:convertNumber type="currency"/>
      </h:outputText>
 	  <h:commandLink action="#{cartBean.addItemAction}">
	    <h:outputText value="Add to Cart"/>
	    <f:param name="itemId" value="#{item.itemId}"/>
	  </h:commandLink>
    </h:panelGrid>     
  </h:column>
</h:dataTable>
<h:panelGrid columns="1" styleClass="standard" columnClasses="rightAlign">
  <h:panelGroup>
    <h:outputLink  value="?page=previous" rendered="#{!productPageBean.pagedListHolder.firstPage}">
	  <h:outputText value=" Prev "/>
    </h:outputLink>
    <h:outputLink  value="?page=next" rendered="#{!productPageBean.pagedListHolder.lastPage}">
	  <h:outputText value=" Next "/>
    </h:outputLink>  
  </h:panelGroup>
</h:panelGrid>
</h:form>
</f:subview>